/*
 * File Name：AppDownBean.java
 * Copyright：Copyright 2008-2014 CiWong.Inc. All Rights Reserved.
 * Description： AppDownBean.java
 * Modify By：res-jianpingliu
 * Modify Date：2014-4-4
 * Modify Type：Add
 */
package com.ciwong.epaper.util.download;

import com.ciwong.mobilelib.bean.BaseBean;

/**
 * 文件下载项
 *
 * @author res-jianpingliu
 * @version ciwong v.1.0 2014-4-4
 * @since ciwong v.1.0
 */
public class DownLoadInfo extends BaseBean implements Cloneable
{

    private static final long serialVersionUID = 604152697645664944L;
    /**
     * 下载地址
     */
    private String url;

    /**
     * 封面地址
     */
    private String iconUrl;

    /**
     * 下载进度
     */
    private int progress;

    /**
     * 下载状态
     */
    private int status;

    /**
     * 保存地址
     */
    private String savePath;

    /**
     * 文件大小
     */
    private String size;

    /**
     * 文件的字节数
     */
    private long length;

    /**
     * 书籍id
     */
    private String bookId = "0";

    /**
     * 章节id
     */
    private String chapterId = "0";

    /**
     * 新的资源类型新增模块ID
     */
    private String moduleId="0";
    /**
     * 新的资源类型新增资源唯一标识版本ID
     */
    private String versionId="0";
    /**
     * 判断是否是新的类型的资源,0旧资源，1新资源
     */
    private int type=0;

    /**
     * subjectId
     */
    private int subjectId;

    /**
     * 书籍名称
     */
    private String bookName;

    /**
     * 章节名称
     */
    private String chapterName;

    private String moduleName;

//    private String ResourseType;

    /**
     * key
     */
    private String key;

    private int isKaoShi;

    /**
     * 是否发布
     */
    private int isPublish;

    private String hash;//
    /**
     * 资源名称
     */
    private String resourceName;



    /**
     * 是否免费（1:免费 0:收费）
     */
    private int isFree;

    private long startTime;


    private boolean isEqualsWork = false;

    private boolean isCheck = false;
    public int groupPosition =-1;
    public int childPosition = -1;
    private String resourceType;
    public String mJsonResPath;
    private boolean isHtmlOffLinePackage;

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public int getTaskId() {
        return taskId;
    }

    public void setTaskId(int taskId) {
        this.taskId = taskId;
    }

    private int taskId;
    public boolean isHtmlOffLinePackage() {
        return isHtmlOffLinePackage;
    }

    public void setHtmlOffLinePackage(boolean htmlOffLinePackage) {
        isHtmlOffLinePackage = htmlOffLinePackage;
    }



    public void setIsPublish(int isPublish) {
        this.isPublish = isPublish;
    }

    public int getIsPublish() {
        return isPublish;
    }

    public boolean isCheck() {
        return isCheck;
    }

    public void setIsCheck(boolean isCheck) {
        this.isCheck = isCheck;
    }

    public String getUrl()
    {
        return url;
    }

    public void setUrl(String url)
    {
        this.url = url;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public void setIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
    }

    public int getProgress()
    {
        return progress;
    }

    public void setProgress(int progress)
    {
        this.progress = progress;
    }

    public int getStatus()
    {
        return status;
    }

    public void setStatus(int status)
    {
        this.status = status;
    }

    public String getSavePath()
    {
        return savePath;
    }

    public void setSavePath(String savePath)
    {
        this.savePath = savePath;
    }

    public String getSize()
    {
        return size;
    }

    public void setSize(String size)
    {
        this.size = size;
    }

    public long getLength()
    {
        return length;
    }

    public void setLength(long length)
    {
        this.length = length;
    }

    public String getBookId()
    {
        return bookId;
    }

    public void setBookId(String bookId)
    {
        this.bookId = bookId;
    }

    public String getChapterId()
    {
        return chapterId;
    }

    public void setChapterId(String chapterId)
    {
        this.chapterId = chapterId;
    }

    public String getBookName()
    {
        return bookName;
    }

    public void setBookName(String bookName)
    {
        this.bookName = bookName;
    }

    public String getChapterName()
    {
        return chapterName;
    }

    public void setChapterName(String chapterName)
    {
        this.chapterName = chapterName;
    }

    public String getKey()
    {
        return key;
    }

    public void setKey(String key)
    {
        this.key = key;
    }

    public int getIsFree()
    {
        return isFree;
    }

    public void setIsFree(int isFree)
    {
        this.isFree = isFree;
    }

    public boolean isEqualsWork()
    {
        return isEqualsWork;
    }

    public void setIsEqualsWork(boolean isEqualsWork)
    {
        this.isEqualsWork = isEqualsWork;
    }

    public void setIsKaoShi(int isKaoShi) {
        this.isKaoShi = isKaoShi;
    }

    public int getIsKaoShi() {
        return isKaoShi;
    }

    public String getHash() {
        return hash;
    }

    public void setHash(String hash) {
        this.hash = hash;
    }

    public String getModuleId() {
        return moduleId;
    }

    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }

    public String getVersionId() {
        return versionId;
    }

    public void setVersionId(String versionId) {
        this.versionId = versionId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }
    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }
    public String getResourceName() {
        return resourceName;
    }

    public void setResourceType(String resourceType) {
        this.resourceType = resourceType;
    }
    public String getResourceType() {
        return resourceType;
    }

    public String getModuleName() {
        return moduleName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }



//    public String getResourseType() {
//        return ResourseType;
//    }
//
//    public void setResourseType(String resourseType) {
//        ResourseType = resourseType;
//    }

    public int getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(int subjectId) {
        this.subjectId = subjectId;
    }

    @Override
    public boolean equals(Object o)
    {
        if (!(o instanceof DownLoadInfo))
        {
            return false;
        }
        DownLoadInfo bean = (DownLoadInfo) o;
        if (isEqualsWork())
        {
            if (getBookId() == null || getChapterId() == null)
            {
                return false;
            }
            return getBookId().equals(bean.getBookId())
                    && getChapterId().equals(bean.getChapterId());
        }
        else
        {
            if (getSavePath() == null)
            {
                return false;
            }
            return getSavePath().equals(bean.getSavePath());
        }
    }

    @Override
    public String toString() {
        return "DownLoadInfo{" +
                "url='" + url + '\'' +
                ", iconUrl='" + iconUrl + '\'' +
                ", progress=" + progress +
                ", status=" + status +
                ", type=" + type +
                ", savePath='" + savePath + '\'' +
                ", size='" + size + '\'' +
                ", length=" + length +
                ", bookId='" + bookId + '\'' +
                ", chapterId='" + chapterId + '\'' +
                ", moduleId='" + moduleId + '\'' +
                ", versionId='" + versionId + '\'' +
                ", bookName='" + bookName + '\'' +
                ", chapterName='" + chapterName + '\'' +
                ", key='" + key + '\'' +
                ", isFree=" + isFree +
                ", isKaoShi="+isKaoShi+
                ", isEqualsWork=" + isEqualsWork +
                ", isCheck=" + isCheck +
                '}';
    }


}
